package top.yzhao.trackdatasystem.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;
import top.yzhao.trackdatasystem.VO.ResultVO;
import top.yzhao.trackdatasystem.model.Sensor;
import top.yzhao.trackdatasystem.service.SensorService;

import java.util.List;

/**
 * User: zhaoyang
 * Date: 2020/3/13
 * Time: 18:20
 * Description: No Description
 */
@RestController
public class SensorController {
    @Autowired
    private SensorService sensorService;

    @PostMapping("/getSensorList")
    public ResultVO<List> getSensorList(){
        ResultVO<List> res = new ResultVO<>();
        List<Sensor> sensorList = sensorService.getSensorList();

        res.setData(sensorList);
        res.setMsg("数据获取成功");
        res.setCode(200);
        return res;
    }
}
